﻿// Decompiled with JetBrains decompiler
// Type: Commom.Util.Url
// Assembly: MT5Trade, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 8045A2CB-DBD6-41AD-8804-F98CAC1BDC8D
// Assembly location: C:\projects\trade\trade_tool\trade0812\MT5Trade.dll

using System.IO;

#nullable enable
namespace Commom.Util;

public static class Url
{
  public static string Combine(params string[] urls) => Path.Combine(urls).Replace("\\", "/");

  public static string Join(string url, string param) => Url.GetUrl(url) + param;

  private static string GetUrl(string url)
  {
    if (!url.Contains("?"))
      return url + "?";
    return url.EndsWith("?") || url.EndsWith("&") ? url : url + "&";
  }
}
